/**
 *                            License
 * THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE TERMS OF THIS  
 * CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR "LICENSE"). 
 * THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE LAW.  
 * ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE OR  
 * COPYRIGHT LAW IS PROHIBITED.
 * 
 * BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND  
 * AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. TO THE EXTENT THIS LICENSE  
 * MAY BE CONSIDERED TO BE A CONTRACT,
 * THE LICENSOR GRANTS YOU THE RIGHTS CONTAINED 
 * HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF SUCH TERMS AND CONDITIONS.
 * 
 */
package lineage.util;

import javax.swing.JTextArea;

import lineage.ui.function.window.main.L1BoxSystemMessage;

/**
 * 系统类.
 * 
 * @version 2014年2月10日下午6:24:56
 * @author jrwz
 */
public final class Util {
    /** 系统信息(图形界面). */
    public final static int SYSTEM_MESSAGE = 0;

    /**
     * 将信息字串输出到显示设备上.
     * 
     * @param msg
     *            - 字串信息
     */
    public static void message(String msg) {
        System.out.println(msg);
    }

    /**
     * 将信息字串输出到显示设备上(图形界面).
     * 
     * @param type
     *            - 信息类型
     * @param msg
     *            - 字串信息
     */
    public static void message(int type, String msg) {
        JTextArea jta = null;
        switch (type) {
        case SYSTEM_MESSAGE:
            jta = L1BoxSystemMessage.getInstance();
            break;
        }
        if (jta != null) {
            jta.append("\r\n");
            jta.append(msg);
            jta.setCaretPosition(jta.getText().length());
        }
    }
}
